﻿@{
    Layout = null;
}
@model List<PR.M.Entity.Models.PhoneResources.CompanyMenu>
@{
    var user = ViewBag.user as PR.M.Entity.Models.PhoneResources.CompanyEmployee;
}
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="~/lib/H-ui.admin/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="~/lib/H-ui.admin/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="~/lib/H-ui.admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="~/lib/H-ui.admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="~/lib/H-ui.admin/static/h-ui.admin/css/style.css" />
    <title>资源管理的信息管理后台</title>
    <meta name="keywords" content="资源管理的信息管理后台">
    <meta name="description" content="资源管理的信息管理后台">
</head>
<body>
    <input type="hidden" id="handle_status" name="handle_status" value="0" />
    <input type="hidden" id="UserPost" name="UserPost" value="@user.Company_Post_Id" />
    <input type="hidden" id="CompanyEmployeeId" name="CompanyEmployeeId" value="@user.Company_Employee_Id" />
    <input type="hidden" id="ChangePassWord" name="ChangePassWord" value="@ViewBag.ChangePassWord" />
    <input type="hidden" id="UsersIds" name="UsersIds" value="@ViewBag.UsersIds" />
    <input type="hidden" id="CheckCompanyEmployeeId" name="CheckCompanyEmployeeId" value="@ViewBag.CheckCompanyEmployeeId" />
    <input type="hidden" id="Webverifykey" name="Webverifykey" value="@ViewBag.Webverifykey" />
    <input type="hidden" id="hrefss" name="hrefss" value="@ViewBag.hrefss" />

    <header class="navbar-wrapper">
        <div class="navbar navbar-fixed-top">
            <div class="container-fluid cl">
                <a class="logo navbar-logo f-l mr-10 hidden-xs" href="#">后台数据运行管理系统</a> <a class="logo navbar-logo-m f-l mr-10 visible-xs" href="#">&nbsp;</a>
                <span class="logo navbar-slogan f-l mr-10 hidden-xs">&nbsp;</span>
                <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:;">&#xe667;</a>
                <nav class="nav navbar-nav">
                    <ul class="cl"></ul>
                </nav>
                <nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
                    <ul class="cl">
                        <li>@ViewBag.CompanyName</li>
                        <li class="dropDown dropDown_hover">
                            <a href="#" class="dropDown_A">@user.RealName<i class="Hui-iconfont">&#xe6d5;</i></a>
                            <ul class="dropDown-menu menu radius box-shadow">
                                @if (user.Company_Employee_Id == 1 || user.Company_Employee_Id == 3 || user.Company_Employee_Id == 59 || user.Company_Employee_Id == 83 || user.Company_Employee_Id == 91 || user.Company_Employee_Id == 79 || user.Company_Employee_Id == 60 || user.Company_Employee_Id == 175 || user.Company_Employee_Id == 153 || user.Company_Employee_Id == 2123)
                                {
                                    <li><a href="javascript:;" onClick="ChangeCompany()">切换公司</a></li>
                                }
                                <li><a href="javascript:;" onClick="EditPass()">修改密码</a></li>
                                <li><a href="javascript:;" onClick="loginOut()">退出</a></li>
                            </ul>
                        </li>
                        <li id="Hui-msg" style="display:none"> <a href="#" title="消息"><span class="badge badge-danger">1</span><i class="Hui-iconfont" style="font-size:18px">&#xe68a;</i></a> </li>
                        @*<li id="Hui-skin" class="dropDown right dropDown_hover">
                                <a href="javascript:;" class="dropDown_A" title="换肤"><i class="Hui-iconfont" style="font-size:18px">&#xe62a;</i></a>
                                <ul class="dropDown-menu menu radius box-shadow">
                                    <li><a href="javascript:;" data-val="default" title="默认（黑色）">默认（黑色）</a></li>
                                    <li><a href="javascript:;" data-val="blue" title="蓝色">蓝色</a></li>
                                    <li><a href="javascript:;" data-val="green" title="绿色">绿色</a></li>
                                    <li><a href="javascript:;" data-val="red" title="红色">红色</a></li>
                                    <li><a href="javascript:;" data-val="yellow" title="黄色">黄色</a></li>
                                    <li><a href="javascript:;" data-val="orange" title="橙色">橙色</a></li>
                                </ul>
                            </li>*@
                    </ul>
                </nav>
            </div>
        </div>
    </header>
    <aside class="Hui-aside">
        <div class="menu_dropdown bk_2">

            @{

                var stair = Model.Where(i => i.ParentId == 1 || i.ParentId == 30 || i.ParentId == 192 || i.ParentId == 299 || i.ParentId == 394 || i.ParentId == 515);
                foreach (var item in stair)
                {
                    <dl id="menu-system">
                        @if (string.IsNullOrEmpty(item.ICON))
                        {
                            <dt><i class="Hui-iconfont">@(item.Menu_Name)</i><i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
                        }
                        else
                        {
                            <dt><i class="Hui-iconfont">&#@(item.ICON);</i> @(item.Menu_Name)<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
                        }
                        <dd>
                            <ul>
                                @foreach (var i in Model.Where(x => x.ParentId == item.Company_Menu_Id).ToList())
                                {
                                    @if (i.URL != null)
                                    {
                                        @if (i.URL.IndexOf("companyEmployeeId") >= 0)
                                        {
                                            <li><a data-href="@i.URL.Replace("CompanyDepartmentCompanyId=","CompanyDepartmentCompanyId="+user.Company_Department_Company_Id).Replace("companyEmployeeId=","companyEmployeeId="+user.Company_Employee_Id+"&Time="+DateTime.Now.ToString("yyyyMMddHHmmss"))#/" data-title="@i.Menu_Name" href="javascript:void(0)">@i.Menu_Name</a></li>
                                        }
                                        else
                                        {
                                            <li><a data-href="@i.URL" data-title="@i.Menu_Name" href="javascript:void(0)">@i.Menu_Name</a></li>
                                        }
                                    }
                                    else
                                    {
                                        <li><a data-href="@i.URL" data-title="@i.Menu_Name" href="javascript:void(0)">@i.Menu_Name</a></li>
                                    }
                                }
                            </ul>
                        </dd>
                    </dl>
                }
            }
        </div>
    </aside>
    <div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>
    <section class="Hui-article-box">
        <div id="Hui-tabNav" class="Hui-tabNav hidden-xs">
            <div class="Hui-tabNav-wp">
                <ul id="min_title_list" class="acrossTab cl">
                    <li class="active">
                        <span title="我的桌面" data-href="/Home/WelCome">我的桌面</span>
                        <em></em>
                    </li>
                </ul>
            </div>
            <div class="Hui-tabNav-more btn-group"><a id="js-tabNav-prev" class="btn radius btn-default size-S" href="javascript:;"><i class="Hui-iconfont">&#xe6d4;</i></a><a id="js-tabNav-next" class="btn radius btn-default size-S" href="javascript:;"><i class="Hui-iconfont">&#xe6d7;</i></a></div>
        </div>
        <div id="iframe_box" class="Hui-article">
            <div class="show_iframe">
                <div style="display:none" class="loading"></div>
                <iframe scrolling="yes" frameborder="0" id="iframes" src="/Home/WelCome" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
            </div>
        </div>
    </section>

    <div class="contextMenu" id="Huiadminmenu">
        <ul>
            <li id="closethis">关闭当前 </li>
            <li id="closeall">关闭全部 </li>
        </ul>
    </div>
    <!--_footer 作为公共模版分离出去-->
    <script src="~/lib/H-ui.admin/lib/jquery/1.9.1/jquery.min.js"></script>
    <script src="~/lib/H-ui.admin/lib/layer/2.4/layer.js"></script>
    <script src="~/lib/H-ui.admin/static/h-ui/js/H-ui.min.js"></script>
    <script src="~/lib/H-ui.admin/static/h-ui.admin/js/H-ui.admin.js"></script>
    <!--/_footer 作为公共模版分离出去-->
    <!--请在下方写此页面业务相关的脚本-->
    <script src="~/lib/H-ui.admin/lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
    <script src="~/js/web_uq_code.js"></script>
    <script src="~/js/Base64Helper.js"></script>
    <script src="~/lib/crypto-js-3.1.9-1/core.js"></script>
    <script src="~/lib/crypto-js-3.1.9-1/cipher-core.js"></script>
    <script src="~/lib/crypto-js-3.1.9-1/tripledes.js"></script>
    <script src="~/js/jquery.cookie.js"></script>
    <script src="~/js/lodash_core.min.js"></script>
    <script src="~/js/websocket.js"></script>


    <script type="text/javascript">
        $(function () {


            setInterval(function () {
                var CheckCompanyEmployeeId = $("#CheckCompanyEmployeeId").val();
                var Webverifykey = $("#Webverifykey").val();
                if (CheckCompanyEmployeeId != "" && Webverifykey!="")
                {
                    $.get("http://appcontent.chenxi618.com:8181/api/Gudashi/GetUnCheckCount?companyEmployeeId=" + CheckCompanyEmployeeId + "&webverifykey=" + Webverifykey, function (result) {
                        if (result.code == 200) 
                        {
                            if (result.data.articleUnCheckCount > 0 || result.data.jyjhUnCheckCount > 0 || result.data.videoUnCheckCount > 0 || result.data.replyUnCheckCount > 0)
                            {
                                var index = layer.open({
                                    type: 1
                                    , offset: 'rb' //具体配置参考：offset参数项
                                    , title: '提醒'
                                    , content: '<div style="padding: 10px 10px; width:280px;height:100px">你有新的回复未审核</div>'
                                    , btn: ['查看', '关闭']
                                    , btnAlign: 'c' //按钮居中
                                    , shade: 0 //不显示遮罩
                                    , time:58000
                                    , yes: function () {
                                        var bStop = false;
		                                var bStopIndex = 0;
                                        var hrefs="";
                                        topWindow = $(window.parent.document),
                                        show_navLi = topWindow.find("#min_title_list li");
                                        iframe_box = topWindow.find("#iframe_box");
                                        show_navLi.each(function() {
                                            if ($(this).find('span').attr("data-href").indexOf("/Webs/appcontent/index.html#/ceid/userCenter")>=0) {
			                                    bStop=true;
			                                    bStopIndex=show_navLi.index($(this));
                                                hrefs = $(this).find('span').attr("data-href");
			                                    return false;
		                                    }
	                                    });

                                        if (!bStop) {
                                            hrefs = $("#hrefss").val();
                                            creatIframe(hrefs, 'App内容发布平台');
                                            min_titleList();
                                        }
                                        else {
                                            show_navLi.removeClass("active").eq(bStopIndex).addClass("active");
                                            iframe_box.find(".show_iframe").hide().eq(bStopIndex).show().find("iframe")[0].contentWindow.postMessage('abc', '*');
                                        }

                                        layer.close(index);
                                    }
                                    , no: function () {
                                        layer.close(index);
                                    }
                                });
                            }
                        }
                    });
                }
            }, 60000);



            //var eqKey = cans();
            //$.post("/User/SetValue", { userUqKey: eqKey }, function (result) {
            //    if (result.code == 200) {
            //        //console.log("原文：" + result.data.token)
            //        //console.log("加密：" + sha1_to_base64(encryptByDES(result.data.token)));
            //        $.cookie('my_uq_value', sha1_to_base64(encryptByDES(result.data.token)), { expires: 1, path: '/' });
            //    }
            //});

            /* 旧的销售信息提醒 */
            //var oldPnId = 0;
            //var newPnId = 0;//最新资源id
            //var postid = $("#UserPost").val();
            //var CompanyEmployeeId = $("#CompanyEmployeeId").val();
            //setInterval(function () {
            //    if (postid == 2) {
            //        $.post("/Resources/GetResourcesLastId", { CompanyEmployeeId: CompanyEmployeeId }, function (result) {
            //            if (result.code == 200) {
            //                newPnId = parseInt(result.Result);
            //                if (oldPnId == 0) { oldPnId = newPnId; }
            //                console.log(oldPnId); console.log(newPnId);
            //                if (newPnId > oldPnId) {
            //                    oldPnId = newPnId;
            //                    layer.open({
            //                        type: 1
            //                        , offset: 'rb' //具体配置参考：offset参数项
            //                        , content: '<div style="padding: 10px 10px; width:180px;height:50px">您有新资源进线，请尽快回访！!</div>'
            //                        , btn: '关闭提醒'
            //                        , btnAlign: 'c' //按钮居中
            //                        , shade: 0 //不显示遮罩
            //                        , yes: function () {
            //                            layer.closeAll();
            //                        }
            //                    });
            //                }

            //            }
            //        });
            //    }
            //}, 10000);
            //setInterval(function () {
            //    var CompanyEmployeeId = $("#CompanyEmployeeId").val();
            //    $.post("/Company/GetUserAlerts", { Company_Employee_Id: CompanyEmployeeId }, function (result) {
            //        if (result.code == 200) {
            //            var index =layer.open({
            //                type: 1
            //                , offset: 'rb' //具体配置参考：offset参数项
            //                , title: result.Result.Titles
            //                , content: '<div style="padding: 10px 10px; width:180px;height:50px">' + result.Result.Content+'</div>'
            //                , btn: ['查看','关闭']
            //                , btnAlign: 'c' //按钮居中
            //                , shade: 0 //不显示遮罩
            //                , yes: function () {
            //                    $('#iframes').attr('src', result.Result.OpenHtml);
            //                    layer.close(index); 
            //                }
            //                , no: function () {
            //                    layer.close(index); 
            //                }
            //            });
            //        }
            //    });
            //}, 10000);

            var ChangePassWord = $("#ChangePassWord").val();
            if (ChangePassWord=="1")
            {
                 var index = layer.open({
                    type: 2,
                    // area: ['460px', '300px'],
                    area: ['800px', '600px'],
                    maxmin: true,
                    title: "您当前使用的密码为原始密码/当前密码强度弱，请先修改后再使用!",
                    content: "/Home/UpdatePassWord",
                    // success: function (layero, index) {
                    //     layer.full(index); // 最大化
                    // },
                    end: function () {
                        var handle_status = $("#handle_status").val();
                        if (handle_status == "1") {
                            window.location = '/Home/LoginOut';
                        }
                        else {
                            window.location = '/Home/LoginOut';
                        }
         
                    }
                });
            }

        });
        //退出
        function loginOut() {
            location.href = "/Home/LoginOut";
        }

    
        /*创建iframe*/
        function creatIframe(href,titleName){
	        var topWindow=$(window.parent.document),
		        show_nav=topWindow.find('#min_title_list'),
		        iframe_box=topWindow.find('#iframe_box'),
		        iframeBox=iframe_box.find('.show_iframe'),
		        $tabNav = topWindow.find(".acrossTab"),
		        $tabNavWp = topWindow.find(".Hui-tabNav-wp"),
		        $tabNavmore =topWindow.find(".Hui-tabNav-more");
	        var taballwidth=0;
		
	        show_nav.find('li').removeClass("active");	
	        show_nav.append('<li class="active"><span data-href="'+href+'">'+titleName+'</span><i></i><em></em></li>');
	        if('function'==typeof $('#min_title_list li').contextMenu){
		        $("#min_title_list li").contextMenu('Huiadminmenu', {
			        bindings: {
				        'closethis': function(t) {
					        var $t = $(t);				
					        if($t.find("i")){
						        $t.find("i").trigger("click");
					        }
				        },
				        'closeall': function(t) {
					        $("#min_title_list li i").trigger("click");
				        },
			        }
		        });
	        }else {
		
	        }	
	        var $tabNavitem = topWindow.find(".acrossTab li");
	        if (!$tabNav[0]){return}
	        $tabNavitem.each(function(index, element) {
                taballwidth+=Number(parseFloat($(this).width()+60))
            });
	        $tabNav.width(taballwidth+25);
	        var w = $tabNavWp.width();
	        if(taballwidth+25>w){
		        $tabNavmore.show()}
	        else{
		        $tabNavmore.hide();
		        $tabNav.css({left:0})
	        }	
	        iframeBox.hide();
	        iframe_box.append('<div class="show_iframe"><div class="loading"></div><iframe frameborder="0" src='+href+'></iframe></div>');
	        var showBox=iframe_box.find('.show_iframe:visible');
	        showBox.find('iframe').load(function(){
		        showBox.find('.loading').hide();
	        });
        }




        function EditPass() {
            var index = layer.open({
                type: 2,
                area: ['800px', '600px'],
                title: "修改密码",
                content: "/Home/UpdatePassWord",
                end: function () {
                    var handle_status = $("#handle_status").val();
                    if (handle_status == "1") {
                        window.location = '/Home/LoginOut';
                    }
                    else {
                        layer.close(index);
                    }
         
                }
            });
            
        }

        function ChangeCompany() {
            var index = layer.open({
                type: 2,
                area: ['400px', '200px'],
                title: "选择公司",
                content: "/Home/ChangeCompanyPage",
                end: function () {
                    window.location = '/';
                }
            });
        }


        



    </script>

    <input type="hidden" id="UsersIds" name="UsersIds" value="@ViewBag.UsersIds" />
    <script type="text/javascript" src="http://test.zfxfu.com:3022/webs/appcontent/useWS.js"></script>
</body>
</html>
